package com.kt.app.ui.components


import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

@Composable
fun ModifierSample() {
    val ctx = LocalContext.current
    Text(
        text = "Hello World",
        color = Color.White,
//        style= TextStyle(
//            background = Color.Blue
//        ),
        modifier = Modifier
            .background(
                color = Color.Red,
                shape = RoundedCornerShape(4.dp)
            )
            .padding(4.dp)
            .clickable {
                Toast.makeText(ctx, "Clicked", Toast.LENGTH_SHORT).show()
            }

    )
}

@Preview
@Composable
fun ModifierSamplePreview() {
    ModifierSample()
}

